<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时间</title>
    <script type="text/javascript" language="JavaScript">
        
          self.setInterval("time()",1000)//每一秒弹出
        function time() {
            var  d=new Date();
            document.getElementById("time1").innerText=d.getFullYear()+"年"+
               d.getMonth()+"月"+d.getDate()+"日"+d.getHours()+"时"+d.getMinutes()+"分"+d.getSeconds()+"秒";
        }
        //innertext 返回标签内的文本值，不包含html标签
    </script>
</head>
<body>
          <span id="time1"></span>
</body>
</html>